<%= form_for [:shop, @seckill_spu], html: { class: "card" } do |f| %>
  <div class="card-body">
    <h3 class="card-title">
      <%= @seckill_spu.new_record? ? "参与限时购" : "修改限时购" %>
    </h3>
    <div class="row">
      <div class="col-md-4">
        <div class="form-group">
          <label class="form-label">参与商品</label>
          <%= f.select :spu_id, @spus.map{ |c| [c.name, c.id] }, { include_blank: '请选择商品' }, { class: 'form-control select' } %>
        </div>
      </div>
      <div class="col-md-4">
        <div class="form-group">
          <label class="form-label">限时购价格</label>
          <%= f.number_field :seckill_price, class: "form-control", step: "0.01" %>
        </div>
      </div>
      <div class="col-md-4">
        <div class="form-group">
          <label class="form-label">限时购数量</label>
          <%= f.number_field :amount, class: "form-control", min: "1" %>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">开始时间</label>
          <%= f.datetime_field :start_at, class: "form-control" %>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">结束时间</label>
          <%= f.datetime_field :end_at, class: "form-control" %>
        </div>
      </div>
      
    </div>
  </div>
  <div class="card-footer text-right">
    <%= f.submit "保 存", class: "btn btn-primary" %>
  </div>
<% end %>